using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._3DAnalystTools._Visibility
{
    /// <summary>
    /// <para>Viewshed</para>
    /// <para>Determines the raster surface locations visible to a set of observer features.</para>
    /// <para>确定对一组观察点要素可见的栅格表面位置。</para>
    /// </summary>    
    [DisplayName("Viewshed")]
    public class Viewshed : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public Viewshed()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_raster">
        /// <para>Input raster</para>
        /// <para>The input surface raster.</para>
        /// <para>输入表面栅格。</para>
        /// </param>
        /// <param name="_in_observer_features">
        /// <para>Input point or polyline observer features</para>
        /// <para><xdoc>
        ///   <para>The feature class that identifies the observer locations.</para>
        ///   <para>The input can be point or polyline features.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>用于标识观察点位置的要素类。</para>
        ///   <para>输入可以是点要素或折线要素。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_out_raster">
        /// <para>Output raster</para>
        /// <para><xdoc>
        ///   <para>The output raster.</para>
        ///   <para>The output will only record the number of times that each cell location in the input surface raster can be seen by the input observation points (or vertices for polylines). The observation frequency will be recorded in the VALUE item in the output raster's attribute table.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出栅格。</para>
        ///   <para>输出将仅记录输入观测点（或折线的折点）可以看到输入表面栅格中每个像元位置的次数。观测频率将记录在输出栅格属性表的 VALUE 项目中。</para>
        /// </xdoc></para>
        /// </param>
        public Viewshed(object _in_raster, object _in_observer_features, object _out_raster)
        {
            this._in_raster = _in_raster;
            this._in_observer_features = _in_observer_features;
            this._out_raster = _out_raster;
        }
        public override string ToolboxName => "3D Analyst Tools";

        public override string ToolName => "Viewshed";

        public override string CallName => "3d.Viewshed";

        public override List<string> AcceptEnvironments => ["autoCommit", "cellSize", "cellSizeProjectionMethod", "compression", "configKeyword", "extent", "geographicTransformations", "mask", "outputCoordinateSystem", "scratchWorkspace", "snapRaster", "tileSize", "workspace"];

        public override object[] ParameterInfo => [_in_raster, _in_observer_features, _out_raster, _z_factor, _curvature_correction.GetGPValue(), _refractivity_coefficient, _out_agl_raster];

        /// <summary>
        /// <para>Input raster</para>
        /// <para>The input surface raster.</para>
        /// <para>输入表面栅格。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_raster { get; set; }


        /// <summary>
        /// <para>Input point or polyline observer features</para>
        /// <para><xdoc>
        ///   <para>The feature class that identifies the observer locations.</para>
        ///   <para>The input can be point or polyline features.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>用于标识观察点位置的要素类。</para>
        ///   <para>输入可以是点要素或折线要素。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input point or polyline observer features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_observer_features { get; set; }


        /// <summary>
        /// <para>Output raster</para>
        /// <para><xdoc>
        ///   <para>The output raster.</para>
        ///   <para>The output will only record the number of times that each cell location in the input surface raster can be seen by the input observation points (or vertices for polylines). The observation frequency will be recorded in the VALUE item in the output raster's attribute table.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出栅格。</para>
        ///   <para>输出将仅记录输入观测点（或折线的折点）可以看到输入表面栅格中每个像元位置的次数。观测频率将记录在输出栅格属性表的 VALUE 项目中。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_raster { get; set; }


        /// <summary>
        /// <para>Z factor</para>
        /// <para><xdoc>
        ///   <para>The number of ground x,y units in one surface z-unit.</para>
        ///   <para>The z-factor adjusts the units of measure for the z-units when they are different from the x,y units of the input surface. The z-values of the input surface are multiplied by the z-factor when calculating the final output surface.</para>
        ///   <para>If the x,y units and z-units are in the same units of measure, the z-factor is 1. This is the default.</para>
        ///   <para>If the x,y units and z-units are in different units of measure, the z-factor must be set to the appropriate factor or the results will be incorrect. For example, if the z-units are feet and the x,y units are meters, you would use a z-factor of 0.3048 to convert the z-units from feet to meters (1 foot = 0.3048 meter).</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>一个曲面 z 单位中的地面 x，y 单位数。</para>
        ///   <para>当 z 单位与输入表面的 x，y 单位不同时，z 因子会调整它们的测量单位。在计算最终输出曲面时，输入曲面的 z 值乘以 z 因子。</para>
        ///   <para>如果 x，y 单位和 z 单位采用相同的测量单位，则 z 因子为 1。这是默认设置。</para>
        ///   <para>如果 x，y 单位和 z 单位采用不同的测量单位，则必须将 z 因子设置为适当的因子，否则结果将不正确。例如，如果 z 单位是英尺，x，y 单位是米，则使用 z 因子 0.3048 将 z 单位从英尺转换为米 （1 英尺 = 0.3048 米）。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Z factor")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double _z_factor { get; set; } = 1;


        /// <summary>
        /// <para>Use earth curvature corrections</para>
        /// <para><xdoc>
        ///   <para>Specifies whether correction for the earth's curvature will be applied.</para>
        ///   <bulletList>
        ///     <bullet_item>Unchecked—No curvature correction will be applied. This is the default.</bullet_item><para/>
        ///     <bullet_item>Checked—Curvature correction will be applied.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是否应用地球曲率校正。</para>
        ///   <bulletList>
        ///     <bullet_item>未选中 - 不应用曲率校正。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>选中 - 将应用曲率校正。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Use earth curvature corrections")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _curvature_correction_value _curvature_correction { get; set; } = _curvature_correction_value._false;

        public enum _curvature_correction_value
        {
            /// <summary>
            /// <para>FLAT_EARTH</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("FLAT_EARTH")]
            [GPEnumValue("false")]
            _false,

            /// <summary>
            /// <para>CURVED_EARTH</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("CURVED_EARTH")]
            [GPEnumValue("true")]
            _true,

        }

        /// <summary>
        /// <para>Refractivity coefficient</para>
        /// <para><xdoc>
        ///   <para>The coefficient of the refraction of visible light in air.</para>
        ///   <para>The default value is 0.13.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>空气中可见光的折射系数。</para>
        ///   <para>默认值为 0.13。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Refractivity coefficient")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double _refractivity_coefficient { get; set; } = 0.13;


        /// <summary>
        /// <para>Output above ground level raster</para>
        /// <para><xdoc>
        ///   <para>The output above ground level (AGL) raster.</para>
        ///   <para>The AGL result is a raster where each cell value is the minimum height that must be added to an otherwise nonvisible cell to make it visible by at least one observer.</para>
        ///   <para>Cells that were already visible will have a value of 0 in this output raster.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出地面以上 （AGL） 栅格。</para>
        ///   <para>AGL 结果是一个栅格，其中每个像元值都是必须添加到原本不可见的像元的最小高度，才能使其至少被一个观察者看到。</para>
        ///   <para>在此输出栅格中，已可见的像元的值为 0。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output above ground level raster")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _out_agl_raster { get; set; } = null;


        public Viewshed SetEnv(int? autoCommit = null, object cellSize = null, object compression = null, object configKeyword = null, object extent = null, object geographicTransformations = null, object mask = null, object outputCoordinateSystem = null, object scratchWorkspace = null, object snapRaster = null, double[] tileSize = null, object workspace = null)
        {
            base.SetEnv(autoCommit: autoCommit, cellSize: cellSize, compression: compression, configKeyword: configKeyword, extent: extent, geographicTransformations: geographicTransformations, mask: mask, outputCoordinateSystem: outputCoordinateSystem, scratchWorkspace: scratchWorkspace, snapRaster: snapRaster, tileSize: tileSize, workspace: workspace);
            return this;
        }

    }

}